package com.test;

import com.mapper.PersonMapper;
import com.pojo.Person;
import org.apache.ibatis.session.SqlSession;
import org.junit.jupiter.api.Test;

public class PersonTest {
    @Test
    public void findPersonByIdTest() {
        SqlSession sqlSession = MyBatisUtils.getSqlSession();
        Person person = sqlSession.
                selectOne("com.test.mapper.PersonMapper.findPersonById", 1);
        System.out.println(person);
        sqlSession.close();
    }@Test
    public void selectPersonByIdTest() {
        SqlSession session = MyBatisUtils.getSqlSession();
        PersonMapper personMapper = session.getMapper(PersonMapper.class);
        Person person = personMapper.selectPersonById(2);
        System.out.println(person.toString());
        session.close();
    }

}
